package com.es.hr.salaryParameter;

import java.util.Enumeration;
import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;

import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class CreateSalaryParameterAction  extends ActionSupport implements ServletRequestAware{

	private static final long serialVersionUID = 1L;
	HttpServletRequest request;
	 
	@SuppressWarnings("unchecked")
	public String execute()throws Exception{
		
		Enumeration<String> enum1 = request.getParameterNames();
		HashMap<String,String[]> map = new  HashMap<String,String[]>();
		 while(enum1.hasMoreElements()){
			 	String key = enum1.nextElement();
				map.put(key, request.getParameterValues(key));
         }

		 SalaryParameterBiz biz = new SalaryParameterBiz();
		 boolean bool = biz.CreateEmpInfoDo(map);
		 
		 if(bool)
			 request.setAttribute("message", "保存工资系数操作成功！");
		 else
			 request.setAttribute("message", "保存工资操作产生错误！");
		 return "success";
	}

	public void setServletRequest(HttpServletRequest request) {
	     this.request = request;
	}
	
}